#ifndef __I2C_H__
#define __I2C_H__

#include "stm32f10x.h"

extern void i2c1_init(unsigned int speed);
extern void i2c2_init(unsigned int speed);

extern int i2c_write_data(I2C_TypeDef *bus, unsigned char addr_7bit, unsigned char reg, const unsigned char *data, unsigned int data_len);
extern int i2c_read_data(I2C_TypeDef *bus, unsigned char addr_7bit, unsigned char reg, unsigned char *buf, unsigned int buf_len);

#endif /* __I2C_H__ */
